Modelling general recursion in type theory
نویسندگان
چکیده
Constructive type theory is a very expressive programming language. However, general recursive algorithms have no direct formalisation in type theory since they contain recursive calls that do not satisfy any syntactic condition that guarantees termination. We present a method to formalise general recursive algorithms in type theory that uses an inductive predicate to characterise termination and that separates the computational and logical parts of the definitions. As a consequence, the resulting typetheoretic algorithms are clear, compact and easy to understand. They are as simple as their Haskell-like versions, where there is no restriction on the recursive calls. Given a general recursive algorithm, our method consists in defining an inductive special-purpose accessibility predicate that characterises the inputs on which the algorithm terminates. The typetheoretic version of the algorithm is then defined by structural recursion on the proof that the input values satisfy this predicate. We give a formal definition of the method and discuss its power and its limitations.
منابع مشابه
Modelling and Experimental Testing of Asymmetric Information Problems in Lease and Hire Contracts (Based on Contract Theory)
This article aims to study lease and hiring contract in the Iranian-Islamic setting and analyze the asymmetric information problem in these contracts. For doing this, we study the characteristics of lease and hiring contracts in Iran (real world experimental characteristics that recognized in other studies), using library method, then we mathematically model different aspects of asymmetric info...
متن کاملThe Recursion Schemes of Scientific Models A Multi-Paradigm Study of the Logistic Map in Haskell
The Squiggol approach to recursive algorithms separates computation and recursion scheme. We revisit the idea in a setting of simple but paradigmatic problems in scientific, particularly ecological, modelling. It is demonstrated that each stereotypic modelling task corresponds to a simple and well-understood recursion pattern, and vice versa. The logistic map is used as the running example of a...
متن کاملThe Clocks Are Ticking: No More Delays! Reduction Semantics for Type Theory with Guarded Recursion
Guarded recursion in the sense of Nakano allows general recursive types and terms to be added to type theory without breaking consistency. Recent work has demonstrated applications of guarded recursion such as programming with codata, reasoning about coinductive types, as well as constructing and reasoning about denotational models of general recursive types. Guarded recursion can also be used ...
متن کاملGeneral Recursion and Formal Topology
It is well known that general recursion cannot be expressed within Martin-Löf’s type theory and various approaches have been proposed to overcome this problem still maintaining the termination of the computation of the typable terms. In this work we propose a new approach to this problem based on the use of inductively generated formal topologies.
متن کاملAn efficient method for the numerical solution of Helmholtz type general two point boundary value problems in ODEs
In this article, we propose and analyze a computational method for numerical solution of general two point boundary value problems. Method is tested on problems to ensure the computational eciency. We have compared numerical results with results obtained by other method in literature. We conclude that propose method is computationally ecient and eective.
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
- Mathematical Structures in Computer Science
دوره 15 شماره
صفحات -
تاریخ انتشار 2005